package com.xuxu.product.entity;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.sql.Time;
import java.util.Date;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/**
 * @author maxuxu
 * @email maxuxu019@gmail.com
 * @date 2022-08-17 18:08:13
 */
@Data
@TableName("product")
@Document(indexName = "pd", type = "product", replicas = 0, shards = 5)
public class ProductEntity implements Serializable {
	private static final long serialVersionUID = 1L;

	/**
	 * id
	 */
	@TableId
	@Id
	@Field(type = FieldType.Text)
	private Long id;
	/**
	 * 商品id
	 */
	@Field(type = FieldType.Text)
	private String pid;
	/**
	 * 商品名称
	 */
	@Field(type = FieldType.Text, analyzer = "ik_max_word")
	private String pname;
	/**
	 * 商品图片
	 */
	@Field(index = false, type = FieldType.Keyword)
	private String pics;
	/**
	 * 点击次数
	 */
	@Field(type = FieldType.Text)
	private Integer pview;
	private String pbody;
	@Field(type = FieldType.Text)
	private Date createDate;
	private Date updateDate;
	@TableLogic(value = "1", delval = "0")
	private Integer status;
	/**
	 * 商品单价
	 */
	@Field(type = FieldType.Text)
	private Float price;
	/**
	 * 商品分类
	 */
	@Field(type = FieldType.Text)
	private String type;
}
